<template>
  <a-config-provider
    :locale="localesMap[locale]"
    :theme="{ token: { colorPrimary: themeConfig.system.themeColor } }"
  >
    <a-spin v-if="menu.loading" tip="菜单加载中······">
      <div style="width: 100vw; height: 100vh"></div>
    </a-spin>
    <global-css v-else>
      <router-view></router-view>
    </global-css>
  </a-config-provider>
</template>
<script lang="ts" setup>
import "dayjs/locale/zh-cn";
import { useI18n } from "vue-i18n";
import { useThemeStore } from "./store/theme";
import enUS from "ant-design-vue/es/locale/en_US";
import zhCN from "ant-design-vue/es/locale/zh_CN";
import GlobalCss from "@/components/global-css/index.vue";
import { useMenuStore } from "./store/menu";
const localesMap: Record<string, any> = {
  "zh-CN": zhCN,
  "en-US": enUS,
};
const { locale } = useI18n();
const themeConfig = useThemeStore();
const menu = useMenuStore();
</script>
